/* 
 * File:   accueil.h
 * Author: Nicolas Proust & Pierre-Antoine Jahan
 *
 * Created on 29 janvier 2013, 14:03
 */

#ifndef _ACCUEIL_H
#define	_ACCUEIL_H

#include "ui_accueil.h"
#include "string.h"
#include "Date.h"
#include <QtXml>
#include "list"
#include "modele/Task.h"
#include "modele/ListOfTask.h"

using namespace std;

class accueil : public QMainWindow {
    Q_OBJECT
public:
    accueil();
    virtual ~accueil();
    void addList(string name, Date date, ListOfTask* temp);
    void addTemplate(string name);
    void modifyList(string name, Date date);
    void modifyTemplate(string name);
    void writeDom();
    void readDom();
    void clearDom();
    void addTask(string title, bool isOrdo, int num, bool ech, bool fixe, Date date, int relat);
    void addTaskTemp(string title, bool isOrdo, int num, bool ech, bool fixe, Date date, int relat);
    void modifyTask(string title, int num, Date date, int relat);
    void modifyTaskTemp(string title, int num, Date date, int relat);
    void split(vector<string>& vecteur, string chaine, char separateur);
    QString boolToString(bool b);
    bool stringToBool(string str);
    void updateViewTasksList();
    void updateViewTasksTemp();
    Task* recTaskFinder(list<Task*> top, string name);
    QDomElement recTaskDom(QDomDocument dom, QDomElement item, list<Task*> listOfunderTasks);
    string afficheDateRelative(int index);
    
public slots :
    //Liste
    void addListListener();  
    void removeList();
    void modifyListListener(); 
    void addTaskListener();
    void afficherTasksListener();
    void removeTask();
    void modifyTaskListener();
    void buttonsListListener();
    void buttonsTaskListener();
    void listListTacheListener();
    void addTaskButtonListener();
    void afficherListesListener();
    void listeTacheAFaireListener();
    
    //Template
    void addTemplateListener();
    void modifyTemplateListener();
    void removeTemplate();
    void addTaskTempListener();
    void afficherTasksTempListener();
    void removeTaskTemp();
    void modifyTaskTempListener();
    void buttonsTemplateListener();
    void buttonsTaskTempListener();
    void addTaskTempButtonListener();
    void utiliserTemplate();
    void tempTacheAFaireListener();
    
private:
    Ui::accueil widget;
    
};

#endif	/* _ACCUEIL_H */
